﻿using System;
using System.Linq;
using System.Collections.Generic;

using agsXMPP;
using agsXMPP.protocol.client;
using agsXMPP.protocol.iq.disco;

namespace SBPweb.Communication.Client.Library.Xmpp.Commands
{

    partial class GetPublicConferencesCommand : Command<DiscoItemsIq, IQ>
    {

        #region Property accessors

        public List<DiscoItem> ConferenceItems
        {
            get;
            protected set;
        }

        #endregion

        #region Methods

        public override DiscoItemsIq GetTypedRequest()
        {
            requestIq = new DiscoItemsIq(IqType.get);
            requestIq.To = new Jid(server);

            return requestIq;
        }

        public override void PutTypedResponse(IQ response)
        {
            responseIq = response;
            ConferenceItems = response.Query.SelectElements<DiscoItem>();
        }

        #endregion

    }

}